﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Scene"
    elementFormDefault="qualified" attributeFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:include schemaLocation="Area.xsd"/>
  <xs:element name="Scene" type="SceneType">
    <xs:key name="SceneNameKey">
      <xs:selector xpath=".
                   |.//Scene
                   |.//SceneRef
                   |.//Area
                   |.//Part"/>
      <xs:field xpath="@Name"/>
    </xs:key>
  </xs:element>

  <xs:complexType name="SceneType">
    <xs:all>
      <xs:element name="Property-List" type="Property-ListType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="Script-List" type="Script-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Area-List" type="Area-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Comments-Link" type="Comments-LinkType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Scene-List" type="Scene-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Parameter-List" type="Parameter-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Template-List" type="Template-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="ShortcutAction-List" type="ShortcutAction-ListType"  minOccurs="0" maxOccurs="1"/>
    </xs:all>
    <xs:attribute name="Name" type="NameType" use="required"/>
    <xs:attribute name="Caption" type="xs:string"/>
    <xs:attribute name="IsHorizontalLoopRender" type="xs:boolean"/>
    <xs:attribute name="IsAllowSwapArea" type="xs:boolean"/>
    <xs:attribute name="IsShowInNavigation" type="xs:boolean"/>
    <xs:attribute name="IsShowQueryPanel" type="xs:boolean"/>
  </xs:complexType>
  <xs:complexType name="CustomActionType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Step"/>
    </xs:choice>
    <xs:attribute name="Caption" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="ShortcutAction-ListType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="CustomAction" type="CustomActionType"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="TemplateType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Part" type="PartType"/>
    </xs:choice>
    <xs:attribute name="Name" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="Template-ListType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Template" type="TemplateType"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="Script-ListType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="script" type="scriptType"/>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="scriptType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Source" type="xs:string" use="required"></xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="Comments-LinkType">
    <xs:attribute name="Name" type="xs:string" use="required"></xs:attribute>
  </xs:complexType>
  <xs:complexType name="Scene-ListType">
    <xs:choice maxOccurs="unbounded">
      <xs:element name="Scene" type="SceneType"/>
      <xs:element name="SceneRef" minOccurs="0">
        <xs:complexType>
          <xs:attribute name="Name" use="required"/>
          <xs:attribute name="Path" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="Parameter-ListType">
    <xs:choice minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Parameter">
        <xs:complexType>
          <xs:attributeGroup ref="ParameterAttr"/>
          <xs:attribute name="Caption" type="xs:string"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:complexType>
  <xs:attributeGroup name="ParameterAttr">
    <xs:attribute name="Name" type="xs:string" />
    <xs:attribute name="ValueString" type="xs:string"/>
    <xs:attribute name="Type" type="xs:string"/>
    <xs:attribute name="Value" type="xs:string"/>
    <xs:attribute name="ValueType" type="xs:string"/>
  </xs:attributeGroup>
</xs:schema>
